#ifndef SIMPLE_CURRENTSENSE_H
#define SIMPLE_CURRENTSENSE_H

#include "BLDCDriver.h"
#include "foc_utils.h"
#include "stdbool.h"
typedef PhaseCurrent_s (*ReadCurrentSence)(void);
typedef struct 
{
    float ia; //!< zero current A voltage value (center of the adc reading)
    float ib; //!< zero current B voltage value (center of the adc reading)
    float ic; //!< zero current C voltage value (center of the adc reading)
}Simple_CurrentSence_Offset;


typedef struct 
{
    ReadCurrentSence read_current;
    Simple_CurrentSence_Offset offset;
    bool initialized; // true if current sense was successfully initialized   
}Simple_CurrentSense_t;
float Simple_getDCCurrent(Simple_CurrentSense_t *handle,float motor_electrical_angle);
DQCurrent_s simple_getFOCCurrents(Simple_CurrentSense_t *handle, float angle_el);
int simple_CurrentSense_driverAlign(Simple_CurrentSense_t *handle,float voltage);
#endif
